<h1 id="byte-array">Byte Array</h1>
<p><code>Quick</code>暂不提供直接操作单个字节，并尽量避免直接操作单个字节。<br>字节数组一般只有操作文件时才会用到</p>
<h3 id="bytearray-创建函数">ByteArray 创建函数</h3>
<table>
<thead>
<tr>
<th>函数</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>newBytes</td>
<td>别名: <code>newbs</code>, 创建一个空的字节数组</td>
</tr>
</tbody></table>
<pre><code class="hljs language-javascript">bs = <span class="hljs-title function_">newbs</span>()
bs.<span class="hljs-title function_">add</span>(<span class="hljs-number">1</span>)
bs.<span class="hljs-title function_">show</span>()
bs.<span class="hljs-title function_">add</span>(<span class="hljs-string">&quot;a&quot;</span>)
bs.<span class="hljs-title function_">show</span>()
bs.<span class="hljs-title function_">add</span>(<span class="hljs-string">&quot;龙&quot;</span>)
bs.<span class="hljs-title function_">show</span>()
</code></pre>
<pre><code>00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001 
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001 01100001 
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001 01100001 11101001 10111110 10011001
</code></pre>
<h3 id="bytearray-方法">ByteArray 方法</h3>
<table>
<thead>
<tr>
<th>方法</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>at</td>
<td>获取指定位置的单个字节字符，以字符串形式返回</td>
</tr>
<tr>
<td>equal</td>
<td>别名：<code>eq</code>， 字节数组与ByteArray或String比较</td>
</tr>
<tr>
<td>str</td>
<td>转字符串</td>
</tr>
<tr>
<td>int</td>
<td>转Integer</td>
</tr>
<tr>
<td>float</td>
<td>转Float</td>
</tr>
<tr>
<td>contain</td>
<td>是否包含指定ByteArray或String</td>
</tr>
<tr>
<td>index</td>
<td>指定ByteArray或String在当前字节数组的位置</td>
</tr>
<tr>
<td>split</td>
<td>根据ByteArray, String, Integer或Float对字节数组进行切割</td>
</tr>
<tr>
<td>add</td>
<td>往字节数组里添加ByteArray, String, Integer或Float</td>
</tr>
<tr>
<td>size</td>
<td>字节数组大小</td>
</tr>
<tr>
<td>show</td>
<td>以二进制形式打印字节数组</td>
</tr>
</tbody></table>
<pre><code class="hljs language-javascript">bs = <span class="hljs-title function_">newbs</span>()
bs.<span class="hljs-title function_">add</span>(<span class="hljs-string">&quot;a1b&quot;</span>)

<span class="hljs-title function_">println</span>(bs.<span class="hljs-title function_">at</span>(<span class="hljs-number">0</span>), bs.<span class="hljs-title function_">at</span>(<span class="hljs-number">1</span>), bs.<span class="hljs-title function_">at</span>(<span class="hljs-number">2</span>))

bs.<span class="hljs-title function_">add</span>(<span class="hljs-number">1024</span>)
<span class="hljs-title function_">println</span>(bs[<span class="hljs-number">3</span>:].<span class="hljs-title function_">int</span>())
</code></pre>
<pre><code>a 1 b
1024
</code></pre>
